<template>
  <div class="app" style="border: 3px solid #000; margin: 10px">
    我是APP组件
    <!-- 2. 父组件监听子组件发射的自定义事件 -->
    <Son :title="myTitle" :hobby="myHobby" @changeTitle="handleChange"></Son>
  </div>
</template>

<script>
import Son from "./components/Son.vue";
export default {
  name: "App",
  data() {
    return {
      myTitle: "学前端一定来黑马",
      myHobby: "敲代码",
    };
  },
  components: {
    Son,
  },
  methods: {
    handleChange(value) {
      // console.log(value);
      this.myTitle = value;
    },
  },
};
</script>

<style>
</style>